<template>
  <el-row>
    <el-col>
      <el-form :inline="true" :model="formInline" size="small">
        <el-form-item label="专题名称">
          <el-input v-model="formInline.value1" style="width: 215px" placeholder="专题名称"></el-input>
        </el-form-item>
        <el-form-item label="专题类型">
          <el-select v-model="formInline.value2" placeholder="专题类型">
            <el-option label="全部" value="0"></el-option>
            <el-option label="教育" value="1"></el-option>
            <el-option label="水利" value="2"></el-option>
            <el-option label="消防" value="3"></el-option>
            <el-option label="卫生" value="7"></el-option>
            <el-option label="林木" value="7"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="专题状态">
          <el-select v-model="formInline.value3" placeholder="专题状态">
            <el-option label="全部" value="0"></el-option>
            <el-option label="有效" value="1"></el-option>
            <el-option label="失效" value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="添加时间">
          <el-date-picker
              v-model="formInline.value4"
              type="daterange"
              align="right"
              unlink-panels
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions">
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="success">查询</el-button>
        </el-form-item>
      </el-form>
      <!--       -->
      <vxe-table :data="tableData">
        <vxe-column type="seq" width="60"></vxe-column>
        <vxe-column field="value1" title="专题名称"></vxe-column>
        <vxe-column field="value2" title="专题类型"></vxe-column>
        <vxe-column field="value3" title="专题状态"></vxe-column>
        <vxe-column field="value4" title="专题地址"></vxe-column>
        <vxe-column field="value5" title="专题备注"></vxe-column>
        <vxe-column field="value6" title="添加时间"></vxe-column>
        <vxe-column title="操作" width="100px">
          <template #default="{ row }">
            <el-button type="text" @click="detailed(row)">详情</el-button>
            <el-button type="text" style="color: #fd3e3e" @click="del(row)">删除</el-button>
          </template>
        </vxe-column>
      </vxe-table>
      <vxe-pager
          :current-page.sync="page.currentPage"
          :page-size.sync="page.pageSize"
          :total="page.totalResult"
          :layouts="['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']">
      </vxe-pager>
    </el-col>
  </el-row>
</template>

<script>
/**
 *{ 我的专题 }
 * @param:
 * @author: 马凯
 * @DateTime: 2022/7/23
 */
export default {
  name: "SpecialList",
data() {
  return {
    formInline: {
      value1: '',
      value2: '',
      value3: '',
      value4: '',
    },
    tableData: [
      {id: '166464165', value1: '专题地图1', value2: '水利地图', value3: '有效', value4: 'url://ff.123.com.cn', value5: '备注', value6: '2022-07-01'},
      {id: '166464163', value1: '专题地图2', value2: '教育地图', value3: '失效', value4: 'url://ff.123.com.cn', value5: '备注', value6: '2022-07-02'},
      {id: '166464162', value1: '专题地图3', value2: '消防地图', value3: '有效', value4: 'url://ff.123.com.cn', value5: '备注', value6: '2022-07-03'},
      {id: '166464161', value1: '专题地图4', value2: '卫生地图', value3: '失效', value4: 'url://ff.123.com.cn', value5: '备注', value6: '2022-07-04'},
      {id: '166464164', value1: '专题地图5', value2: '林木地图', value3: '有效', value4: 'url://ff.123.com.cn', value5: '备注', value6: '2022-07-05'}
    ],
    page: {
      currentPage: 1,
      pageSize: 10,
      totalResult: 300
    },
  }
},
methods: {
  /**
   *{ 详情 }
   * @param:
   * @author: 马凯
   * @DateTime: 2022/7/23
   */
  detailed(row) {
    this.$router.push({
      name: 'SpecialDetailed',
      query: {
        id: row.id
      }
    })
  },
  /**
   *{ 删除 }
   * @param:
   * @author: 马凯
   * @DateTime: 2022/7/23
   */
  del(row) {
    this.$confirm(`此操作将永久删除该申请, 是否继续?`, '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning'
    }).then(() => {
      this.$message({
        type: 'success',
        message: '删除成功!' + row.value1
      });
    });
  }
}
}
</script>

<style scoped>

</style>